# -*- coding: utf8 -*-

_author_ = "boboxu"

if __name__=='__main__':
    '''
    添加工作路径
    引用自己写的模块
    '''
    import sys
    import os
    # 获取当前绝对路径
    curPath = os.path.abspath(os.path.dirname(__file__))
    rootPath = os.path.split(curPath)[0]+'\..'
    # 设置模块搜索路径为Root目录
    sys.path.append(rootPath)

# 自己的模块
from LQT.event_engine.event_engine_base import *
from LQT.event_engine.event_timer import *
from LQT.constant import *

def run_bar_engine(strategy):
    '''

    '''

    bar_engine = EventEngineBase()
    event_timer=EventTimer()
    event_timer.event_data_dict["strategy_data"] = strategy
    bar_engine.put(event_timer)
    bar_engine.register(EventType.EVENT_TIMER.value, EventTimer.update_timer)

    bar_engine.start(timer=True)
    bar_engine.stop()